import os
import pyqrcode
from pyqrcode import QRCode

def getUserInput():
    data = input("请输入想生成二维码的数据(仅限英语，数字) $ ")
    return data

def makeQRCode():
    url = pyqrcode.create(getUserInput())
    url.png('./QRCode.png', scale=5, module_color="#7D007D", background=[0xff, 0xff, 0xcc])
    print("已保存二维码！\n")    
    os.system(".\\QRCode.png")

if __name__ == "__main__":
    makeQRCode()